package com.litian.dancechar.framework.common.thread;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;

/**
 * 线程池参数配置
 *
 * @author litian
 * @date 2021/6/14 22:28
 */
@Configuration
@Slf4j
@RefreshScope
@Data
public class ThreadPoolConfig {
    @Value("${thread.pool.corePoolSize:200}")
    private Integer threadPoolCorePoolSize;

    @Value("${thread.pool.maxPoolSize:200}")
    private Integer threadPoolMaxPoolSize;

    @Value("${thread.pool.queueCapacity:10000}")
    private Integer threadPoolQueueCapacity;

    @Value("${thread.pool.waitForTasksToCompleteOnShutdown:true}")
    private Boolean waitForTasksToCompleteOnShutdown;

    @Value("${thread.pool.awaitTerminationSeconds:60}")
    private Integer awaitTerminationSeconds;
}
